import request from '../common/http.js'
var api = request
export default {
	//发送短信
	sendCode: (data) => {
		return api.request('/api/user/sms_code/', data, "POST")
	},
	//登录
	login: (data) => {
		return api.request('/api/user/login/', data, "POST")
	},
	//获取图片
	getImg: (resourcePath,data) => {
		return api.request(`/media/${resourcePath}`, data, "GET")
	},
	//获取token
	getToken: (data) => {
		return api.request('/api/user/csrftoken/', data, "GET")
	},
	//用户信息
	getUserInfo: (rid, data) => {
		return api.request(`/api/user/${rid}/`, data, "GET")
	},
	//更新用户信息
	editUserInfo: (rid, data) => {
		return api.request(`/api/user/${rid}/`, data, "PATCH")
	},
	//实名认证
	userRealName: (data) => {
		return api.request('/api/user/authenticate_user/', data, "POST")
	},
	//悬赏列表
	getRewardList: (data) => {
		return api.request('/api/tasks/', data, "GET")
	},
	//悬赏详情
	getRewardInfo: (rid, data) => {
		return api.request(`/api/tasks/${rid}/`, data, "GET")
	},
	//发布悬赏
	addTask: (data) => {
		return api.request('/api/tasks/', data, "POST")
	},
	//删除悬赏
	delTask: (rid, data) => {
		return api.request(`/api/tasks/${rid}/`, data, "DELETE")
	},
	//接单
	getOrder: (rid, data) => {
		return api.request(`/api/tasks/accept/${rid}/`, data, "POST")
	},
	//评价列表
	getEvaluateList: (data) => {
		return api.request('/api/ratings/', data, "GET")
	},
	//关注列表
	getFollowList: (data) => {
		return api.request('/api/user/focus/', data, "GET")
	},
	//统计关注、粉丝、信用分
	getUserFansNum: (rid, data) => {
		return api.request(`/api/statistic/user/${rid}/`, data, "GET")
	},
	//获取用户已发布的列表
	getPublishList: (data) => {
		return api.request('/api/tasks/my_published_tasks/', data, "GET")
	},
}